import { createApp } from "vue";
import App from "./App.vue";
import pinia from "@/store";
import router from "@/router";
import "@/router/permission";

import "@/styles/index.scss";

// Antd
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import * as Icons from "@ant-design/icons-vue";

const app = createApp(App);

app.use(Antd);

// 注册icon组件
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key as keyof typeof Icons]);
});

// 挂载pinia状态管理
app.use(pinia);

// 挂载路由
app.use(router);

app.mount("#app");
